<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<title>海外仓订单日志</title>
<script type="text/javascript">
    function addstock()
    {
        $('#changstatusform').modal('show');
    }
    function changstock()
    {
        $('#changstockform').modal('show');
    }

    function stockout()
    {
        var vote_arr = document.getElementsByName("ppid[]");
        var idarr = new Array();
        var i=0;
        var str="";
        for(var j = 0; j < vote_arr.length; j++)
        {
            if(vote_arr[j].checked == true)
            {
                idarr[i] = vote_arr[j].value;
                str += vote_arr[j].value+",";
                i++;
            }

        }
        if(i<=0){
            alert("未选中数据");
        }else{
            $.post("/oversea/ajaxbutton", {"op": "stockout","str":str},
                    function(data){

                        if(data)
                        {
                            var tmp = "";
                            for(var i=0;i<data.length;i++)
                            {
                                tmp+="  <tr>";
                                tmp+=" <td class=\"head0\" width=15%>"+data[i].sku+"</td>";
                                tmp+=" <td class=\"head1\" width=35%>"+data[i].goodsname+"</td>";
                                tmp+=" <td class=\"head0\" width=25%>"+data[i].stock+"</td>";
                                tmp+=' <td class=\"head1\" width=25%><input type="text" name="nums[]" id="nums" class="width50" value="{{$li.check_id}}" placeholder="填写数字")"  /><input type="hidden" name="id[]"  class="width50" value='+data[i].id+' /><input type="hidden" name="sku[]"  class="width50" value='+data[i].sku+' /></td>';

                            }

                            $("#showlist").html(tmp);
                        }

                    },"json");
        }

        $('#stockoutform').modal('show');
    }
</script>
<body class="withvernav">
<div class="bodywrapper">
    {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent tables">
        <div class="pageheader notab">
            <h1 class="pagetitle">海外仓订单日志</h1>
            <span class="pagedesc"></span>
        </div>
        <!--pageheader-->

        <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
        <div id="contentwrapper" class="contentwrapper">
            <!--搜索栏-->
            <form class="stdform stdform2" method="get" action="/overseaapi/showOrderLogOversea">
                <div class="tableoptions">
                    订单号: <input type="text" name="order_sn" id="order_sn" class="width100" placeholder="请输入订单号" value="{{$order_sn}}" />
                    状态:
                    <select name="status" id="status">
                        <option value="">-状态-</option>
                        <option value="1" {{if $status=='1'}} selected{{/if}}>成功</option>
                        <option value="0" {{if $status=='0'}} selected{{/if}}>失败</option>
                    </select>
                    <button class="btn btn_orange btn_search radius50">Search</button>
                    <!--
                    &nbsp;&nbsp;&nbsp;&nbsp;  <a href="javascript:void(0)" onClick="stockout(1)" class="btn btn2 btn_help"><span>出库</span></a>
                    -->
                </div>
            </form>
            <!--搜索栏结束-->
 <div class="x_content" style="overflow-x:auto;">
            <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                <thead>
                <tr>
                    <th class="head1">序号</th>
                    <th class="head0">订单号</th>
                    <th class="head1">发货单号</th>
                    <th class="head0">运单号</th>
                    <th class="head1">日志记录</th>
                    <th class="head0">成功标记</th>
                    <th class="head0">发货仓库</th>
                    <th class="head1">添加时间</th>
                </tr>
                </thead>
                <tbody>
                {{foreach from=$list item=li key=key}}
                <tr>
                    <td>{{$li.id}}</td>
                    <td><a href="/orderlist/orderlist?kw={{$li.order_sn}}">{{$li.order_sn}}</a></td>
                    <td>{{$li.salesOrderId}}</td>
                    <td>{{$li.shipping_number}}</td>
                    <td style="width: 360px;">{{$li.errorMessage}}</td>
                    <td>
                        {{if $li.isSuccess eq 1}}
                        成功
                        {{else}}
                        <span style="color:red;">失败</span>
                        {{/if}}
                    </td>
                    <td class="center">
                        {{if $li.shipping_status==0}}
                            未分仓
                        {{/if}}
                        {{if $li.shipping_status==1}}
                        英华英国仓
                        {{/if}}
                        {{if $li.shipping_status==2}}
                        英华德国仓
                        {{/if}}
                        {{if $li.shipping_status==3}}
                        EZGO美国仓
                        {{/if}}
                        {{if $li.shipping_status==4}}
                         万邑通美西仓
                        {{/if}}
                        {{if $li.shipping_status==5}}
                        一号仓
                        {{/if}}
                    </td>
                    <td class="center">{{$li.addTime}}</td>
                </tr>
                {{/foreach}}
                </tbody>

            </table>
            </div>
            <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
            <br />
            <br />
        </div>
    </div>
    <!--bodywrapper-->
   
</body>
</html>